package dao

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Account  string `gorm:"type:varchar(10);not null;comment:账号;unique"`
	Password string `gorm:"type:varchar(255);not null;comment:密码"`
	Image    string `gorm:"type:varchar(255);not null;comment:头像"`
	Name     string `gorm:"type:varchar(20);not null;comment:昵称;index"`
	Sign     string `gorm:"type:varchar(255);not null;comment:个性签名"`
}

// 好友表
type Friend struct {
	gorm.Model
	UserId   int    `gorm:"type:int(3);not null;comment:用户id"`
	FriendId int    `gorm:"type:int(3);not null;comment:好友id"`
	Name     string `gorm:"type:varchar(20);not null;comment:好友昵称"`
	Status   int    `gorm:"type:int(1);not null;default:2;comment:1-置顶 2-未置顶"`
}

// 群聊
type Group struct {
	gorm.Model
	UserId int    `gorm:"type:int(3);not null;comment:用户id"`
	Code   int    `gorm:"type:int(10);not null;comment:群号"`
	Name   string `gorm:"type:varchar(20);not null;comment:群名称"`
}
type GroupMember struct {
	gorm.Model
	UserId  int64 `gorm:"type:int(3);not null;comment:用户id"`
	GroupId int64 `gorm:"type:int(3);not null;comment:群组id"`
	Sign    int   `gorm:"type:int(1);not null;default:2;comment:1-群主 2-管理员 3-成员"`
}
type Video struct {
	gorm.Model
	UserId int    `gorm:"type:int(3);not null;comment:用户id"`
	Url    string `gorm:"type:varchar(255);not null;comment:视频地址"`
	Likes  int    `gorm:"type:int(5);not null;comment:点赞量"`
	Looks  int    `gorm:"type:int(5);not null;comment:浏览量"`
}
